﻿<!DOCTYPE html>
<!--承包商人员名录管理编辑-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <style>
        .elst-select-mini {
            margin-bottom: 10px
        }
    </style>
</head>

<body>
    <div id="app" v-cloak class="popupW100">
        <el-form :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px" size="mini"
            label-position="right">
            <el-row>
                <el-col :span="11">
                    <p class="main-label">{{ContractorPersonnelDirectory.PersonnelName+mark.m}}</p>
                    <p class="lh35">{{Form.PersonnelName}}</p>
                </el-col>

                <el-col :span="11" :offset="2">
                    <p class="main-label">{{ContractorPersonnelDirectory.sex+mark.m}}</p>
                    <p class="lh35">{{Form.sex}}</p>
                </el-col>
                <el-col :span="11">
                    <p class="main-label">{{ContractorPersonnelDirectory.phone+mark.m}}</p>
                    <p class="lh35">{{Form.phone}}</p>
                </el-col>
                <el-col :span="11" :offset="2">
                    <p class="main-label">{{ContractorPersonnelDirectory.ContractorName+mark.m}}</p>
                    <p class="lh35">{{Form.ContractorName}}</p>
                </el-col>
                <el-col :span="11">
                    <p class="main-label">{{ContractorPersonnelDirectory.IDNumber+mark.m}}</p>
                    <p class="lh35">{{Form.IDNumber}}</p>
                </el-col>
                <el-col :span="11" :offset="2">
                    <p class="main-label">{{ContractorPersonnelDirectory.ConstructionCategory+mark.m}}</p>
                    <p class="lh35">{{Form.ConstructionCategory}}</p>
                </el-col>
                <el-col :span="11">
                    <p class="main-label">{{ContractorPersonnelDirectory.YearMonth+mark.m}}</p>
                    <p class="lh35">{{Form.YearMonth}}</p>
                </el-col>
            </el-row>
            <br>
            <el-row>
                <el-col span="24">
                    <el-table stripe :data="Form.EmploymentLicenseList" style="width: 100%">
                        <el-table-column prop="LicenseName" show-overflow-tooltip="true"
                            :label="ContractorPersonnelDirectory.LicenseName">
                            <template slot-scope="scope">
                                <el-button type="text" @click="label_click('xz',scope.row.id)">
                                    {{scope.row.LicenseName}}
                                </el-button>
                            </template>
                        </el-table-column>
                        <el-table-column prop="BeginTime" :label="ContractorPersonnelDirectory.BeginTime"
                            show-overflow-tooltip="true">
                        </el-table-column>
                        <el-table-column prop="EndTime" :label="ContractorPersonnelDirectory.EndTime"
                            show-overflow-tooltip="true">
                        </el-table-column>
                        <el-table-column prop="EditorTime" :label="ContractorPersonnelDirectory.EditorTime"
                            show-overflow-tooltip="true">
                        </el-table-column>
                    </el-table>
                </el-col>
            </el-row>


            <el-row type="flex" justify="end" style="margin-top:10px">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnCommit}}</el-button>
                    <el-button type="primary" @click="onBack">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog title="承包商人员名录管理" fullscreen="true" :visible.sync="ListItem.dialogVisible" @close='closeDialog'
            width="80%" height="80%" top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">

        var app = new Vue({
            el: '#app',
            data: {
                id: '',
                Title: '',
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    PersonnelName: '',
                    sex: '',
                    phone: '',
                    ContractorName: '',
                    IDNumber: '',
                    ConstructionCategory: '',
                    MainaAchievement: '',
                    Age: '',
                    EmploymentLicenseList: [],
                },
                ConstructionCategory: [],
                CheckProjectList: [],
                ListItem: ListItem,
                sex: [],
                //表单验证
                rules: {
                    PersonnelName: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(2, 5), message: verification.StringLengthAtoB.m.format(2, 5), trigger: 'blur' }
                    ],
                    ContractorName: [
                        verification.NotNull,
                        { pattern: verification.StringLengthAtoB.t.format(5, 50), message: verification.StringLengthAtoB.m.format(5, 10), trigger: 'blur' }
                    ],
                    ConstructionCategory: [
                        verification.NotNull
                    ],
                    sex: [
                        verification.NotNull
                    ]
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //点击表格中数据发生方法
                label_click: function (val, id) { DialogShow(this, val, "ContractorPersonnelDirectoryManagementInputMineImg.html", id); },
                UserInput: function (val, id) {
                    this.Title = "上岗证照管理"
                    DialogShow(this, val, "ContractoEmploymentLicenseAdd.html", id);
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/BlackContractorPersonnelDirectoryManagement/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });
                },
                getData: function () {
                    getData(this, '/api/BlackContractorPersonnelDirectoryManagement/get?id=' + this.id);
                },
                ContractorInput: function (val, id) {
                    this.Title = "承包商列表"
                    DialogShow(this, val, "ContractorDirectoryList.html", id);
                },
                onBack: function () {
                    parent.app.ListItem.dialogVisible = false;
                },
                deleteRow: function (index, rows) {
                    rows.splice(index, 1);
                },
            },
            mounted: function () {
                this.ConstructionCategory = getDicData('25');
                this.sex = getDicData('01');
                this.id = getUrlParam("id");
                this.getData();
            }
        });
    </script>
</body>

</html>